<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?php echo __("MyWiWall installation tool"); ?></title>
	<style type="text/css" media="screen">
		@import url(../views/common/css/install.css);
	</style>
</head>

<body>
	<h1><?php echo __("MyWiWall installation tool"); ?></h1>
	<div id="installation_tool">
		
		<?php if ($comingAgain): ?>
		<div id="error">
			<?php echo $errorMessage; ?>
		</div>
		<?php endif; ?>
	
		<form name="install" action="index.php" method="post">
			<fieldset>
				<legend><?php echo __("General"); ?></legend>
				<div class="field_line"><label for="application_name">Application name:</label><input class="input_text" id="application_name" type="text" name="application_name" value="<?php if ($comingAgain) echo $_POST['application_name']; ?>"/></div>
				<div class="field_line"><label for="portal_uri">Portal URI:</label><input class="input_text" id="portal_uri" type="text" name="portal_uri" value="<?php if ($comingAgain) echo $_POST['portal_uri']; ?>"/></div>
			</fieldset>
			
			<fieldset>
				<legend><?php echo __("Database"); ?></legend>
				<div class="field_line"><label for="database_url">Database address:</label><input class="input_text" id="database_url" type="text" name="database_url" value="<?php if ($comingAgain) echo $_POST['database_url']; ?>"/></div>
				<div class="field_line"><label for="database_login">Database login:</label><input class="input_text" id="database_login" type="text" name="database_login" value="<?php if ($comingAgain) echo $_POST['database_login']; ?>"/></div>
				<div class="field_line"><label for="database_password">Database password:</label><input class="input_text" id="database_password" type="text" name="database_password"/></div>
				<div class="field_line"><label for="database_name">Database name:</label><input class="input_text" id="database_name" type="text" name="database_name" value="<?php if ($comingAgain) echo $_POST['database_name']; ?>"/></div>
			</fieldset>
			
			<fieldset>
				<legend><?php echo __("Graphical User Interface"); ?></legend>
				<div class="field_line">
					<label for="theme_name">Theme:</label>
					<select id="theme_name" name="theme_name">
						<?php foreach ($availableThemes as $theme): ?><option <?php if ($comingAgain && $_POST['theme_name'] == $theme) echo 'selected="true"'; ?> value="<?php echo $theme; ?>"><?php echo $theme; ?></option><?php endforeach; ?>
					</select>
				</div>
				<div class="field_line">
					<label for="language">Language:</label>
					<select id="language" name="language">
						<?php foreach ($availableLanguages as $lg): ?><option <?php if ($comingAgain && $_POST['language'] == $lg) echo 'selected="true"'; ?> value="<?php echo $lg; ?>"><?php echo $lg; ?></option><?php endforeach; ?>
					</select>
				</div>
			</fieldset>
			
			<fieldset>
				<legend><?php echo __("Connectivity"); ?></legend>
				<div class="field_line"><label for="openid_mode">Use OpenID</label><input class="input_checkbox" id="openid_mode" type="checkbox" name="openid_mode" value="openid" <?php if ($comingAgain && isset($_POST['openid_mode'])) echo 'checked="true"' ; ?>/></div>
				<div class="field_line"><label for="service_browser_activate">Use Service Browser</label><input class="input_checkbox" id="service_browser_activate" type="checkbox" name="service_browser_activate" value="service_browser" <?php if ($comingAgain && isset($_POST['service_browser_activate'])) echo 'checked="true"' ; ?>/></div>
				<div class="field_line"><label for="service_browser_uri">Service Browser URI :</label><input class="input_text" id="service_browser_uri" type="text" name="service_browser_uri" value="<?php if ($comingAgain) echo $_POST['service_browser_uri']; ?>"/></div>
			</fieldset>
			
			<fieldset>
				<legend><?php echo __("Miscellaneous"); ?></legend>
				<div class="field_line"><label for="logs_users_activate">Log login of users</label><input class="input_checkbox" id="logs_users_activate" type="checkbox" name="logs_users_activate" value="log_users" <?php if ($comingAgain && isset($_POST['logs_users_activate'])) echo 'checked="true"' ; ?>/></div>
				<div class="field_line"><label for="logs_users_path">Path of the logging file:</label><input class="input_text" id="logs_users_path" type="text" name="logs_users_path" value="<?php if ($comingAgain) echo $_POST['logs_users_path']; ?>"/></div>
			</fieldset>
			
			<div id="validation">
				<input id="validate_install" type="submit" name="validate_install" value="<?php echo __("Install MyWiWall"); ?>"/>
				<input id="reset_install" type="reset" name="reset_install" value="<?php echo __("Reset form"); ?>"/>
			</div>
		</form>
	</div>
</body>
</html>
